<template>
  <el-card>
    <el-form :inline="true" :model="searchData" class="demo-form-inline">
      <el-form-item label="ID">
        <el-input v-model="searchData.id" placeholder="填写角色ID" clearable />
      </el-form-item>
      <el-form-item label="角色名称">
        <el-input v-model="searchData.name" placeholder="填写角色名称" clearable />
      </el-form-item>
      <el-form-item label="角色状态">
        <el-select v-model="searchData.status" placeholder="状态" clearable>
          <el-option label="禁用" :value="0" />
          <el-option label="启用" :value="1" />
        </el-select>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSearchSubmit">搜索</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const prop = defineProps<{
  searchData: {
    id: string
    name: string
    status: string
  }
}>()

const searchData = ref(prop.searchData)
const emit = defineEmits(['onSearchSubmit'])
const onSearchSubmit = () => {
  emit('onSearchSubmit')
}
</script>

<style lang="scss" scoped>
.demo-form-inline .el-input {
  --el-input-width: 220px;
}

.demo-form-inline .el-select {
  --el-select-width: 220px;
}
</style>
